<%@ include file="/common/taglibs.jsp"%>

<head>
	<title><fmt:message key="content.manager" /></title>
	<link rel="stylesheet" type="text/css" media="all"
		href="<c:url value='/ext/styles/content/content.css'/>" />
	<script type="text/javascript"
		src="<c:url value='/ext/scripts/date/WdatePicker.js'/>">
</script>
	<script language="javascript" type="text/javascript"
		src="/zywx3/ext/scripts/display/displaypage.js">
</script>
	<script type="text/javascript"
		src="<c:url value='/ext/scripts/index/index.js'/>">
</script>

	<script type="text/javascript">
function getListByProperties(strvalue) {
	return strvalue.split(',');
}
function delcontent() {
	var message = "<fmt:message key='content.del.ok'/>";
	if (confirm(message)) {
		return true;
	} else {
		return false;
	}
}jQuery(document).ready(
				function() {
					jQuery("#displayallpage").val(${displayallpage});
	                jQuery("#tz").val(${thispage});
				});
				
		function checkseartime(){
			var starttime=document.getElementById("startimeid");
			var endtime=document.getElementById("endtimeid");
			var errorinfo=document.getElementById("errorinfo");
			var timeerror="<fmt:message key='content.searchtime.error' />";
			if(starttime.value!=null&&starttime.value!=""&&endtime.value!=null&&endtime.value!=""){
				if(starttime.value>endtime.value){
					errorinfo.innerHTML=timeerror;
					endtime.focus();
					return false;
				}
			}
			return true;
		}
</script>

</head>
<div class="box_big" style="padding-bottom: 15px;">
	<form:form commandName="contentsid" method="post" id="searchForm"
		action="${ctx}/content/querycontent.html">
		<div class="bj_biao" onclick="hiddenselectcon();">
		<div class="tabbiao">
			<div class="r">
				<div class="con">
					<div style="float: left; width: 100%; margin: 0; padding: 0;" onclick="hiddenselectcon();">
						<h6>
							<fmt:message key="user.selectcon" />
						</h6>
					</div>
				</div>
			</div>
		</div>
			
		</div>
		<div class="box5" id="selectcondiv" style="display: none;">
			<table border="0" cellspacing="0" cellpadding="0" class="table_cx2">
				<tr height="18">
					<th>
						<fmt:message key="content.title" />
						:
					</th>
					<td>
						<form:input path="contentTitle" cssClass="text3" size="12" />
					</td>
					<th>
						<fmt:message key="content.add.time" />
						:
					</th>
					<td colspan="3">

						<form:input id="startimeid" path="startime" cssClass="time"
							onclick="WdatePicker({dateFmt:'yyyy-MM-dd',lang:'${lang}'})" />
						<fmt:message key="content.time.fanwei" />
						<form:input id="endtimeid" path="endtime" cssClass="time"
							onclick="WdatePicker({dateFmt:'yyyy-MM-dd',lang:'${lang}'})" />
					</td>
				</tr>
				<tr>
					<th>
						<fmt:message key="content.type" />
						:
					</th>
					<td>
						<form:select id="typeid" path="contentType" cssClass="text4">
							<c:forEach var="c" items="${contenttypelist}">
								<form:option value="${c.key}">${c.value}</form:option>
							</c:forEach>
						</form:select>
					</td>
					<th>
						<fmt:message key="content.isrelease" />
						:
					</th>
					<td>
						<form:select path="isRelease" id="isreleaseid" cssClass="text4">
							<c:forEach var="c" items="${isreleaselist}">
								<form:option value="${c.key}">${c.value}</form:option>
							</c:forEach>
						</form:select>
					</td>
					<th>
						<fmt:message key="content.language" />
						:
					</th>
					<td>
						<form:select path="language" id="languageid" cssClass="text4">
							<c:forEach var="c" items="${langagetypelist}">
								<form:option value="${c.key}">${c.value}</form:option>
							</c:forEach>
						</form:select>
					</td>
				</tr>
			</table>
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr height="50" valign="top">
					<td align="center">
						<input type="submit" onclick="return checkseartime();"
							 class="btn_search" />
					</td>
				</tr>
			</table>
		</div>
		<div class="box5">
		
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr height="50" valign="top">
					<td align="left">
						<input type="button"
							onclick="location.href='<c:url value="queryaddcontent.html"/>'"
							
							class="btn_add" />
					</td>
					<td align="center">
						<div id="errorinfo" style="color: red;"></div>
					</td>
				</tr>
			</table>
			
		</div>
	</form:form>
	<div class="ceng_mar5">
		<display:table name="contentlist" cellspacing="0" cellpadding="0"
			requestURI="" style="width:100%;" defaultsort="1" id="contents"
			pagesize="${pagesize}" class="table_display" export="true"
			size="${resultSize}" partialList="true" defaultorder="descending">
			<display:column property="contentId" escapeXml="true" sortable="true"
				titleKey="content.id" style="border-left:1px solid #feb808;" />
			<display:column property="contentTitle" escapeXml="true"
				sortable="true" titleKey="content.title" />
			<display:column property="strContentType" escapeXml="true"
				sortable="true" titleKey="content.type" />
			<display:column escapeXml="true" sortable="true"
				titleKey="content.isrelease">
				<c:if test="${contents.isRelease==1}">
					<fmt:message key="content.isrelease.yes" />
				</c:if>
				<c:if test="${contents.isRelease==2}">
					<fmt:message key="content.isrelease.no" />
				</c:if>
			</display:column>


			<display:column property="contentTime" sortable="true"
				format="{0,date,yyyy-MM-dd HH:mm:ss}" maxLength="10"
				titleKey="content.add.time" style="width: 20%" />


			<display:column titleKey="content.man" autolink="true" media="html"
				style="border-right:1px solid #feb808;">
				<a
					href="${ctx}/content/contentinfo.html?conid=${contents.contentId }&langtype=${contents.language}"><fmt:message
						key="content.info" /> </a>
		
		<a
					href="${ctx}/content/updatecontent.html?conid=${contents.contentId }&langtype=${contents.language}&thispage=${thispage}&pagename=${pagename}"><fmt:message
						key="content.update" /> </a>&nbsp;&nbsp;&nbsp;
			<a
					href="${ctx}/content/deletecontent.html?conid=${contents.contentId }&langtype=${contents.language}&thispage=${thispage}&pagename=${pagename}"
					onclick="return delcontent()"><fmt:message key="content.delete" />
				</a>
			</display:column>
			<display:setProperty name="export.pdf" value="false" />
			<display:setProperty name="export.csv" value="false" />
			<display:setProperty name="export.xml" value="false" />
		</display:table>
	</div>
</div>
